#include<bits/stdc++.h>
#define int long long
using namespace std;
int T,x; 
signed main(){
	freopen("tree.in","r",stdin);
	freopen("tree.out","w",stdout);
	ios::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
	cin>>T;
	while(T--) {
		cin>>x;
		if(x==0) {
			cout<<"2\n";
			continue ;
		}
		int w=sqrt(x);
		while(x%w!=0&&(x%w)%2!=w%2)
			w++;
		int ans=w+x/w+(x%w>0?1:0)+1;
		cout<<ans<<"\n";
	}
	return 0;
}
/*
(x%w)%2==w%2
*/
